import http from '@/utils/http'
import fourWheelHttp from '@/utils/fourWheelHttp'

export function login(params) {
  const checkKey = localStorage.getItem('checkKey')
  let url = '/open/systemUserLogin'
  return http.request({
    method: 'post',
    url: url,
    data: params,
    headers: { 'rsa-check-key': checkKey },
  })
}
//  四轮登录
export function loginFourWheel(params) {
  const checkKey = localStorage.getItem('checkKey')
  let url = '/open/systemUserLogin'
  return fourWheelHttp.request({
    method: 'post',
    url: url,
    data: params,
    headers: { 'rsa-check-key': checkKey },
  })
}
export function userInfo() {
  let url = '/login-open/userInfo'
  return http.post(url)
}
export function logout() {
  const url = '/login-open/logout'
  return http.post(url)
}
export function getMenu() {
  const url = 'xyyc/menus'
  return http.post(url)
}
// 获取手机验证码
export function getCode(params) {
  const url = '/open/sendSmsCerficationCode'
  return http.post(url, params)
}

//判断手机号是否以存在
export function mobileIsExist(params) {
  const url = '/xyyc/mobileIsExist'
  return http.post(url, params)
}

// 获取消息通知
export function getMessages(params) {
  const url = '/login-open/getMessages'
  return http.post(url, params)
}

// 获取消息设置
export function getMessageSetting(params) {
  const url = '/login-open/getMessageSetting'
  return http.post(url, params)
}

// 删除消息中心信息
export function delMessages(params) {
  const url = '/login-open/delMessages'
  return http.post(url, params)
}

// 获取消息通知未读状态
export function getUnreadStatus(params) {
  const url = '/login-open/getUnreadStatus'
  return http.post(url, params)
}

// 消息设置
export function setMessageSettings(params) {
  const url = '/login-open/messageSetting'
  return http.post(url, params)
}

// 获取小易通知列表
export function selectHycMessagePage(params) {
  const url = '/login-open/selectHycMessagePage'
  return http.post(url, params)
}

// 获取二轮跳转四轮的token
export function jumpFourWheel(params) {
  const url = '/home-page/home-page/jumpFourWheel'
  return http.get(url, params)
}
